.chat-app {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-header {
    background-color: #4a6ea9;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.room-info {
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f7fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    max-width: 80%;
}

.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.ai-message {
    margin-right: auto;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.user-message .avatar {
    background-color: #4a6ea9;
    color: white;
}

.ai-message .avatar {
    background-color: #67c23a;
    color: white;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    background-color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-content {
    background-color: #93c5fd;
}

.ai-message .message-content {
    background-color: white;
}

.sender-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.message-text {
    word-break: break-word;
    line-height: 1.5;
}

.message-text pre {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-text code {
    font-family: 'Courier New', Courier, monospace;
}

.chat-input {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    min-height: 40px;
    max-height: 120px;
}

.chat-input textarea:focus {
    border-color: #4a6ea9;
}

.chat-input button {
    margin-left: 10px;
    padding: 0 20px;
    background-color: #4a6ea9;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

.chat-input button:hover {
    background-color: #3a5a89;
}

.chat-input button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.chat-input button i {
    margin-right: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-app {
        height: 100vh;
        width: 100%;
    }

    .message {
        max-width: 90%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease-in-out;
}

/* 加载动画 */
.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4a6ea9;
    margin: 0 2px;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}